<script>
/**
 * Widget Component
 */
export default {
  data() {
    return {
      statData: [
        {
          title: "24小时采集数据",
          icon: "ri-stack-line",
          value: "26.3万条",
          subvalue: "24.9万条",
          text: '昨日数据'
        },
        {
          title: "24小时采集异常",
          icon: "ri-store-2-line",
          value: "1.2万条",
          subvalue: "1.5万条",
          text: '昨日异常'
        },
        {
          title: "24小时解析异常",
          icon: "ri-briefcase-4-line",
          value: "0.9万条",
          subvalue: "1.5万条",
          text: '昨日异常'
        }
      ],
      statData2: [
        {
          title: "手动配置采集",
          icon: "ri-archive-drawer-line",
          value: "120个实例",
          subvalue: "10个实例",
          text: '失效配置'
        },
        {
          title: "自动配置采集",
          icon: "ri-at-fill",
          value: "2,120个实例",
          subvalue: "52个实例",
          text: '失效配置'
        },
        {
          title: "代码配置采集",
          icon: "ri-bar-chart-box-line",
          value: "34个实例",
          subvalue: "2个实例",
          text: '失效配置'
        }
      ]
    };
  },
  methods: {
    screenblock(v){
      console.log(v);
      // alert(v.title)
    },
  }
};
</script>

<template>
  <div>
    <div class="row">
      <div class="col-md-4" v-for="(data, index) in statData" :key="index">
        <div class="card pointer" @click="screenblock(data)">
          <div class="card-body">
            <div class="media">
              <div class="media-body overflow-hidden">
                <p class="text-truncate font-size-14 mb-2">{{data.title}}</p>
                <h4 class="mb-0">{{data.value}}</h4>
              </div>
              <div class="text-primary">
                <i :class="`${data.icon} font-size-24`"></i>
              </div>
            </div>
          </div>

          <div class="card-body border-top py-3">
            <div class="text-truncate">
              <!-- badge-soft-success 成功    badge-soft-danger 错误 -->
              <span v-if="index!=1" class="badge badge-soft-success font-size-11">
                <!-- <i class="mdi mdi-menu-up"></i> -->
                {{data.subvalue}}
              </span>
              <span v-else class="badge badge-soft-danger font-size-11">
                {{data.subvalue}}
              </span>
              <span class="text-muted ml-2">{{data.text}}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-md-4" v-for="(data, index) in statData2" :key="index">
        <div class="card pointer" @click="screenblock(data)">
          <div class="card-body">
            <div class="media">
              <div class="media-body overflow-hidden">
                <p class="text-truncate font-size-14 mb-2">{{data.title}}</p>
                <h4 class="mb-0">{{data.value}}</h4>
              </div>
              <div class="text-primary">
                <i :class="`${data.icon} font-size-24`"></i>
              </div>
            </div>
          </div>

          <div class="card-body border-top py-3">
            <div class="text-truncate">
              <!-- badge-soft-success 成功    badge-soft-danger 错误 -->
              <span v-if="index!=1" class="badge badge-soft-success font-size-11">
                <!-- <i class="mdi mdi-menu-up"></i> -->
                {{data.subvalue}}
              </span>
              <span v-else class="badge badge-soft-danger font-size-11">
                {{data.subvalue}}
              </span>
              <span class="text-muted ml-2">{{data.text}}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- end row -->
</template>